package io;

import java.io.*;

public class CopyByteFile {
    public static void main(String[] args) throws IOException {
        File srcFile = new File("C:\\Users\\ASUS\\Desktop\\Files\\test.txt");
        File descFile = new File("C:\\Users\\ASUS\\Desktop\\Files\\new.txt");


        FileInputStream inputStream = new FileInputStream(srcFile);
        FileOutputStream outputStream = new FileOutputStream(descFile);

        byte[] bufs = new byte[1024];


        int length = inputStream.read(bufs);

        while(length != -1){
            outputStream.write(bufs,0,length);
            length = inputStream.read(bufs);
        }
        outputStream.flush();
    }
}
